<template>
	<view class="layout">
		<view class="navbar">
			<view class="statusBar" :style="{height:getstatusBarHeight()+'px'}"></view>
			<view class="titleBar" :style="{height:getTitleBarHeight()+'px'}">
				<view class="title">{{title}}</view>
				<view class="search" @click="toSearch">
					<uni-icons class="icon" type="search" color="#888" size="18"></uni-icons>
					<text class="text">搜索</text>
				</view>
			</view>
		</view>
		<view class="fill" :style="{height:getstatusBarHeight()+getTitleBarHeight()+'px'}"></view>
	</view>
</template>

<script setup>
import { computed, ref } from 'vue';
import {getstatusBarHeight,getTitleBarHeight} from "@/utils/system.js"

defineProps({
	title:{
		type:String,
		default:"壁纸"
	}
})


const toSearch = () => {
	uni.navigateTo({url:'/pages/search/search'})
}



</script>
<style scoped lang="scss">
.layout {
	.navbar{
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 100;
		background:
		linear-gradient(to bottom,transparent,rgba(255,255,255,.8),#fff 400rpx),
		linear-gradient(to right,#beecd8 20%,#f4e2d8);
		
		.statusBar{
			// border: 1px solid red;
		}
		
		.titleBar{
			display: flex;
			padding: 0 30rpx;
			align-items: center;
			// border: 1px solid magenta;
			
			.title{
				font-size: 22px;
				font-weight: 700;
				color: $text-font-color-1;
			}
			
			.search{
				width: 220rpx;
				height: 50rpx;
				border-radius: 60rpx;
				background: rgba(255, 255, 255, .4);
				border: 1px solid #fff;
				margin-left: 30rpx;
				color: #999;
				font-size: 28rpx;
				display: flex;
				align-items: center;
				
				.icon{
					margin-left: 5rpx;
				}
				
				.text{
					padding-left: 10rpx;
				}
			}
		}
	}
}
</style>
<style></style>
